global save save

if "`c(username)'"=="marco"  {
global dropbox "/Users/${username}/Dropbox"
global master_file_path "${dropbox}/Engel_GFT/replication_files"
global stataloc "C:\Program Files\Stata17\StataMP-64.exe"
global intermediate "$master_file_path/data/intermediate_data"
global input "$master_file_path/data/source_data"
cd "$input"
}

else if "`c(username)'"=="YOUR NAME"  {
global dropbox "C:/Users/SET USERNAME HERE/Dropbox"
}


********************
*LOCALS
********************

local i_V1 1

if 1==1{
use "$intermediate/R43/concorded_consumption_items43.dta",clear
gen round=43
rename grouplabel43 concorded_group_labels
gen grouplabel=""


replace grouplabel="cereals" if concorded_group_labels=="cereals - rice"
replace grouplabel="cereals" if concorded_group_labels=="cereals - wheat"
replace grouplabel="cereals" if concorded_group_labels=="cereals - jowar"
replace grouplabel="cereals" if concorded_group_labels=="cereals -  bajra"
replace grouplabel="cereals" if concorded_group_labels=="cereals - maize"
replace grouplabel="cereals" if concorded_group_labels=="cereals - barley"
replace grouplabel="cereals" if concorded_group_labels=="cereals - small millets"
replace grouplabel="cereals" if concorded_group_labels=="cereals - ragi"
replace grouplabel="gram" if concorded_group_labels=="gram"
replace grouplabel="cereal substitutes" if concorded_group_labels=="cereal substitutes"
replace grouplabel="pulses and pulse products" if concorded_group_labels=="pulses"
replace grouplabel="pulses and pulse products" if concorded_group_labels=="pulse products"
replace grouplabel="milk and milk products" if concorded_group_labels=="milk and milk products"
replace grouplabel="edible oils" if concorded_group_labels=="edible oils"
replace grouplabel="meat, egg, fish" if concorded_group_labels=="meat, egg, fish - red meat"
replace grouplabel="meat, egg, fish" if concorded_group_labels=="meat, egg, fish  - poultry and fish"
replace grouplabel="vegetable" if concorded_group_labels=="vegetable - root vegetables"
replace grouplabel="vegetable" if concorded_group_labels=="vegetable - gourds"
replace grouplabel="vegetable" if concorded_group_labels=="leafy vegetables"
replace grouplabel="vegetable" if concorded_group_labels=="other vegetables"
replace grouplabel="fresh fruits" if concorded_group_labels=="fresh fruits"
replace grouplabel="fresh fruits" if concorded_group_labels=="fresh fruits - others"
replace grouplabel="dry fruits and nuts" if concorded_group_labels=="dry fruits and nuts"
replace grouplabel="sugar" if concorded_group_labels=="sugar"
replace grouplabel="salt" if concorded_group_labels=="salt"
replace grouplabel="spices" if concorded_group_labels=="spices"
replace grouplabel="beverages, refreshments and processed food" if concorded_group_labels=="beverages, refreshments and processed food - beverages"
replace grouplabel="beverages, refreshments and processed food" if concorded_group_labels=="beverages, refreshments and processed food - refreshments and processed food"
replace grouplabel="pan" if concorded_group_labels=="pan"
replace grouplabel="tobacco" if concorded_group_labels=="tobacco"
replace grouplabel="intoxicants" if concorded_group_labels=="intoxicants"
replace grouplabel="fuel and light" if concorded_group_labels=="fuel and light"
replace grouplabel="clothing" if concorded_group_labels=="clothing - personal wear"
replace grouplabel="clothing" if concorded_group_labels=="clothing - linens"
replace grouplabel="clothing" if concorded_group_labels=="clothing - other"
replace grouplabel="footwear" if concorded_group_labels=="footwear"
replace grouplabel="amusement" if concorded_group_labels=="amusement"
replace grouplabel="education" if concorded_group_labels=="education"
replace grouplabel="consumer services" if concorded_group_labels=="consumer services"
replace grouplabel="medical" if concorded_group_labels=="medical"
replace grouplabel="personal care and effect" if concorded_group_labels=="personal care and effect"
replace grouplabel="toilet articles" if concorded_group_labels=="toilet articles"
replace grouplabel="sundry articles" if concorded_group_labels=="sundry articles"
replace grouplabel="conveyance" if concorded_group_labels=="conveyance"
replace grouplabel="miscellaneous consumer services" if concorded_group_labels=="miscellaneous consumer services"
replace grouplabel="rents" if concorded_group_labels=="rent"
replace grouplabel="furniture and fixture" if concorded_group_labels=="furniture and fixture - furniture"
replace grouplabel="furniture and fixture" if concorded_group_labels=="furniture and fixture -fixture"
replace grouplabel="recreation, entertainment and hobbies" if concorded_group_labels=="Goods recreation, entertainment and hobbies"
replace grouplabel="recreation, entertainment and hobbies" if concorded_group_labels=="Goods for recreation, entertainment, and hobbies - others"
replace grouplabel="jewellery and ornaments" if concorded_group_labels=="jewellery and ornaments"
replace grouplabel="utensils and crockery" if concorded_group_labels=="Household utensils"
replace grouplabel="cooking and household appliances" if concorded_group_labels=="cooking and household appliances"
replace grouplabel="cooking and household appliances" if concorded_group_labels=="cooking and household appliances - others"
replace grouplabel="personal transport equipment" if concorded_group_labels=="personal transport equipment"
replace grouplabel="other personal goods" if concorded_group_labels=="therapeutic appliances and equipments"
replace grouplabel="other personal goods" if concorded_group_labels=="other personal goods"
replace grouplabel="residential building, land & other durables" if concorded_group_labels=="residential building, land & other durables"
replace grouplabel="taxes and cesses" if concorded_group_labels=="consumer taxes ad cesses"

gen supergrouplabel=""
replace supergrouplabel="food" if grouplabel=="cereals"
replace supergrouplabel="food" if grouplabel=="gram"
replace supergrouplabel="food" if grouplabel=="cereal substitutes"
replace supergrouplabel="food" if grouplabel=="pulses and pulse products"
replace supergrouplabel="food" if grouplabel=="milk and milk products"
replace supergrouplabel="food" if grouplabel=="edible oils"
replace supergrouplabel="food" if grouplabel=="meat, egg, fish"
replace supergrouplabel="food" if grouplabel=="vegetable"
replace supergrouplabel="food" if grouplabel=="fresh fruits"
replace supergrouplabel="food" if grouplabel=="dry fruits and nuts"
replace supergrouplabel="food" if grouplabel=="sugar"
replace supergrouplabel="food" if grouplabel=="salt"
replace supergrouplabel="food" if grouplabel=="spices"
replace supergrouplabel="food" if grouplabel=="beverages, refreshments and processed food"
replace supergrouplabel="food" if grouplabel=="pan"
replace supergrouplabel="food" if grouplabel=="tobacco"
replace supergrouplabel="food" if grouplabel=="intoxicants"
replace supergrouplabel="non-food " if grouplabel=="fuel and light"
replace supergrouplabel="non-food " if grouplabel=="clothing"
replace supergrouplabel="non-food " if grouplabel=="footwear"
replace supergrouplabel="services" if grouplabel=="amusement"
replace supergrouplabel="services" if grouplabel=="education"
replace supergrouplabel="services" if grouplabel=="consumer services"
replace supergrouplabel="services" if grouplabel=="medical"
replace supergrouplabel="non-food " if grouplabel=="personal care and effect"
replace supergrouplabel="non-food " if grouplabel=="toilet articles"
replace supergrouplabel="non-food " if grouplabel=="sundry articles"
replace supergrouplabel="services" if grouplabel=="conveyance"
replace supergrouplabel="services" if grouplabel=="miscellaneous consumer services"
replace supergrouplabel="services" if grouplabel=="rents"
replace supergrouplabel="durables" if grouplabel=="furniture and fixture"
replace supergrouplabel="durables" if grouplabel=="recreation, entertainment and hobbies"
replace supergrouplabel="durables" if grouplabel=="jewellery and ornaments"
replace supergrouplabel="durables" if grouplabel=="utensils and crockery"
replace supergrouplabel="durables" if grouplabel=="cooking and household appliances"
replace supergrouplabel="durables" if grouplabel=="personal transport equipment"
replace supergrouplabel="durables" if grouplabel=="other personal goods"
replace supergrouplabel="durables" if grouplabel=="residential building, land & other durables"
replace supergrouplabel="services" if grouplabel=="taxes and cesses"
*Since "other imputed value of owned conveyance" not asked in R55 drop in R50 and R43 for budget share calculations:
drop if itemcode43==635
drop if expenditure==0
rename statecode43 state43
*rename socioeconomic vars to match those in R55
rename HHreligiousCode Religion
rename HHgroupCode Caste
rename HHsize Household_size
save "$intermediate/R43/expenditures_R43.dta",replace
}



if 1==1{
use "$intermediate/R55/concorded_consumption_items55.dta",clear
gen round=55
rename Per_capitaexpenditure mpce
rename Household_size hhsize

gen grouplabel=""
replace grouplabel="cereals" if concorded_group_labels=="Cereals - rice"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - wheat"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - jowar"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - bajra"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - maize"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - barley"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - small millets"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - ragi"
replace grouplabel="gram" if concorded_group_labels=="Gram"
replace grouplabel="cereal substitutes" if concorded_group_labels=="Cereal substitutes"
replace grouplabel="pulses and pulse products" if concorded_group_labels=="Pulses"
replace grouplabel="pulses and pulse products" if concorded_group_labels=="Pulse products"
replace grouplabel="milk and milk products" if concorded_group_labels=="Milk and milk products"
replace grouplabel="edible oils" if concorded_group_labels=="Edible oils - processed"
replace grouplabel="edible oils" if concorded_group_labels=="Edible oils"
replace grouplabel="meat, egg, fish" if concorded_group_labels=="Meat, egg, fish - red meat"
replace grouplabel="meat, egg, fish" if concorded_group_labels=="Meat, egg, fish - poultry and fish"
replace grouplabel="vegetable" if concorded_group_labels=="Vegetable - root vegetables"
replace grouplabel="vegetable" if concorded_group_labels=="Vegetable - gourds"
replace grouplabel="vegetable" if concorded_group_labels=="Vegetable - leafy vegetables"
replace grouplabel="vegetable" if concorded_group_labels=="Vegetable - other vegetables"
replace grouplabel="fresh fruits" if concorded_group_labels=="Fresh fruits"
replace grouplabel="fresh fruits" if concorded_group_labels=="fresh fruits - others"
replace grouplabel="dry fruits and nuts" if concorded_group_labels=="Dry fruits and nuts"
replace grouplabel="sugar" if concorded_group_labels=="Sugar"
replace grouplabel="salt" if concorded_group_labels=="Salt"
replace grouplabel="spices" if concorded_group_labels=="Spices"
replace grouplabel="beverages, refreshments and processed food" if concorded_group_labels=="Beverages, refreshments, and processed food - beverages"
replace grouplabel="beverages, refreshments and processed food" if concorded_group_labels=="Beverages, refreshments, and processed food - other beverages"
replace grouplabel="beverages, refreshments and processed food" if concorded_group_labels=="Beverages, refreshments, and processed food - refreshments and processed food"
replace grouplabel="pan" if concorded_group_labels=="Pan"
replace grouplabel="tobacco" if concorded_group_labels=="Tobacco"
replace grouplabel="intoxicants" if concorded_group_labels=="Intoxicants"
replace grouplabel="fuel and light" if concorded_group_labels=="Fuel and light"
replace grouplabel="fuel and light" if concorded_group_labels=="Fuel and light - gas"
replace grouplabel="clothing" if concorded_group_labels=="Clothing - personal wear"
replace grouplabel="clothing" if concorded_group_labels=="Clothing - linens"
replace grouplabel="clothing" if concorded_group_labels=="Clothing - other"
replace grouplabel="footwear" if concorded_group_labels=="Footwear"
replace grouplabel="amusement" if concorded_group_labels=="Entertainment"
replace grouplabel="education" if concorded_group_labels=="Education"
replace grouplabel="consumer services" if concorded_group_labels=="Consumer services"
replace grouplabel="medical" if concorded_group_labels=="Medical"
replace grouplabel="personal care and effect" if concorded_group_labels=="Personal care and effect"
replace grouplabel="toilet articles" if concorded_group_labels=="Toilet articles"
replace grouplabel="sundry articles" if concorded_group_labels=="Sundry articles"
replace grouplabel="sundry articles" if concorded_group_labels=="Sundry articles - detergents"
replace grouplabel="consumer services" if concorded_group_labels=="Consumer services - others"
replace grouplabel="conveyance" if concorded_group_labels=="Conveyance"
replace grouplabel="conveyance" if concorded_group_labels=="Conveyance fuels"
replace grouplabel="miscellaneous consumer services" if concorded_group_labels=="Pet animals and others"
replace grouplabel="rents" if concorded_group_labels=="Rents"
replace grouplabel="furniture and fixture" if concorded_group_labels=="Furniture and fixture - furniture"
replace grouplabel="furniture and fixture" if concorded_group_labels=="furniture and fixture - fixture"
replace grouplabel="recreation, entertainment and hobbies" if concorded_group_labels=="Goods for recreation, entertainment, and hobbies"
replace grouplabel="recreation, entertainment and hobbies" if concorded_group_labels=="Goods for recreation, entertainment, and hobbies - others"
replace grouplabel="jewellery and ornaments" if concorded_group_labels=="Jewellery and ornaments"
replace grouplabel="utensils and crockery" if concorded_group_labels=="Household utensils"
replace grouplabel="cooking and household appliances" if concorded_group_labels=="Cooking and household appliances"
replace grouplabel="cooking and household appliances" if concorded_group_labels=="cooking and household appliances - others"
replace grouplabel="personal transport equipment" if concorded_group_labels=="Personal transport equipment"
replace grouplabel="other personal goods" if concorded_group_labels=="Therapeutic appliances and equipments"
replace grouplabel="other personal goods" if concorded_group_labels=="Other personal goods"
replace grouplabel="residential building, land & other durables" if concorded_group_labels=="residential building, land & other durables"
replace grouplabel="taxes and cesses" if concorded_group_labels=="consumer taxes ad cesses"
replace grouplabel="cereals" if concorded_group_labels=="Cereals - other"

gen supergrouplabel=""
replace supergrouplabel="food" if grouplabel=="cereals"
replace supergrouplabel="food" if grouplabel=="gram"
replace supergrouplabel="food" if grouplabel=="cereal substitutes"
replace supergrouplabel="food" if grouplabel=="pulses and pulse products"
replace supergrouplabel="food" if grouplabel=="milk and milk products"
replace supergrouplabel="food" if grouplabel=="edible oils"
replace supergrouplabel="food" if grouplabel=="meat, egg, fish"
replace supergrouplabel="food" if grouplabel=="vegetable"
replace supergrouplabel="food" if grouplabel=="fresh fruits"
replace supergrouplabel="food" if grouplabel=="dry fruits and nuts"
replace supergrouplabel="food" if grouplabel=="sugar"
replace supergrouplabel="food" if grouplabel=="salt"
replace supergrouplabel="food" if grouplabel=="spices"
replace supergrouplabel="food" if grouplabel=="beverages, refreshments and processed food"
replace supergrouplabel="food" if grouplabel=="pan"
replace supergrouplabel="food" if grouplabel=="tobacco"
replace supergrouplabel="food" if grouplabel=="intoxicants"
replace supergrouplabel="non-food " if grouplabel=="fuel and light"
replace supergrouplabel="non-food " if grouplabel=="clothing"
replace supergrouplabel="non-food " if grouplabel=="footwear"
replace supergrouplabel="services" if grouplabel=="amusement"
replace supergrouplabel="services" if grouplabel=="education"
replace supergrouplabel="services" if grouplabel=="consumer services"
replace supergrouplabel="services" if grouplabel=="medical"
replace supergrouplabel="non-food " if grouplabel=="personal care and effect"
replace supergrouplabel="non-food " if grouplabel=="toilet articles"
replace supergrouplabel="non-food " if grouplabel=="sundry articles"
replace supergrouplabel="services" if grouplabel=="conveyance"
replace supergrouplabel="services" if grouplabel=="miscellaneous consumer services"
replace supergrouplabel="services" if grouplabel=="rents"
replace supergrouplabel="durables" if grouplabel=="furniture and fixture"
replace supergrouplabel="durables" if grouplabel=="recreation, entertainment and hobbies"
replace supergrouplabel="durables" if grouplabel=="jewellery and ornaments"
replace supergrouplabel="durables" if grouplabel=="utensils and crockery"
replace supergrouplabel="durables" if grouplabel=="cooking and household appliances"
replace supergrouplabel="durables" if grouplabel=="personal transport equipment"
replace supergrouplabel="durables" if grouplabel=="therapeutic appliances and equipments"
replace supergrouplabel="durables" if grouplabel=="other personal goods"
replace supergrouplabel="durables" if grouplabel=="residential building, land & other durables"
replace supergrouplabel="services" if grouplabel=="taxes and cesses"

drop if expenditure==0
*Taxes not asked in R43 so drop here:
drop if grouplabel=="taxes and cesses"
drop if Srl_no_of_item==539

*merge in district code concordances:
merge m:1 state55 district55 using "$input/R55/concordance_district_55_43"
drop if _merge==2

gen Sector="Rural" if sector==1
replace Sector="Urban" if sector==2

drop sector
rename Sector sector

rename Social_group Caste
rename hhsize Household_size
save "$intermediate/R55/expenditures_R55.dta",replace
}




use "$intermediate/R43/expenditures_R43.dta", clear
append using "$intermediate/R55/expenditures_R55.dta"

drop if wt==0  | wt==.
drop if hhid==.
drop if state43==. | district43==.
drop if sector==""


*now the 50th round codes merged three districts together, so merge here as well
*Bihar	Gumla	Ranchi	This needs to be merged
replace district43=30 if state43==4 & district43==37
*Arunachal	West Siang	East Siang	This needs to be merged
replace district43=5 if state43==25 & district43==6
*Haryana	Sonepat	Rohtak	This needs to be merged
replace district43=5 if state43==6 & district43==6

gen flag_inconsistent_recall=0
replace flag_inconsistent_recall=1 if grouplabel=="education" | grouplabel=="medical"

*Deaton and Tarozzi cleanup:
gen concorded_itemlabel2=concorded_itemlabel
replace concorded_itemlabel2=itemlabel43_55c if round==43

gen flag_deaton_drops=0
label var flag_deaton_drops "deaton-tarozzi drops consumption items from CPI, Paasche estimates"

*Drops due to unclear quantity data (inconsistently measured across households) Table A2 D&T
replace flag_deaton_drops=1 if itemcode43==273
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other fresh fruits"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other beverages: cocoa, chocolate, etc."
replace flag_deaton_drops=1 if concorded_itemlabel2=="Biscuits"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Salted refreshments"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Prepared sweets"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other processed food (gm.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other drugs and intoxicants"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Dung cake"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Gobar gas"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other fuel"
*Drops due to units of measurement changing between rounds (Table A5 D&T):
replace flag_deaton_drops=1 if concorded_itemlabel2=="Lemon"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Guava"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Cheroot (no.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Zarda, kimam, surti (gm.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other tobacco products (gm)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Ganja"
*Tables A3 and A4 D&T:
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other wheat products"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Ice-cream"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other milk products"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other nuts"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other dry fruits"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Ice  "
replace flag_deaton_drops=1 if concorded_itemlabel2=="Fruit juice and shake (glass)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="other ingredients for pan"
replace flag_deaton_drops=1 if concorded_itemlabel2=="L.P.G [kg.]"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Candle (no.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="cereal substitutes (tapioca, jackfruit seed etc.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other spices (gm)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Other meat, birds, and fish"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Coconut"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Tea (cups)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Coffee (powder)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Cold beverage (bottled or canned) no."
replace flag_deaton_drops=1 if concorded_itemlabel2=="Cake, pastry"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Pan (leaf)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Hookah tobacco (kg.)"
replace flag_deaton_drops=1 if concorded_itemlabel2=="Toddy"

*Deaton: Drop items that have less than 20 purchases in each districtXsector
gen one=1
egen sum_purchases=total(one), by(concorded_itemlabel2 round)
egen min_purchases_rounds=min(sum_purchases), by(concorded_itemlabel2)
tab concorded_itemlabel2 if min_purchases_rounds<40
drop if min_purchases_rounds<40
drop one

replace concorded_itemlabel2=trim(concorded_itemlabel2)

*Get rid of products beyond fuel and light:
replace flag_deaton_drops=1 if round==43 & itemcode43>=480
replace flag_deaton_drops=1 if round==55 & Srl_no_of_item>=360


*generate i group definition:
if `i_V1'==1 {
gen i_groupsV1=""
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="cereal substitutes (tapioca, jackfruit seed etc.)"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Bajra & products"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Barley & products"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Jowar & products"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Maize & products"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Other cereals"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Ragi & products"
replace i_groupsV1="Cereals - rice" if concorded_itemlabel2=="Rice"
replace i_groupsV1="Cereals - rice" if concorded_itemlabel2=="Chira"
replace i_groupsV1="Cereals - rice" if concorded_itemlabel2=="Other rice products"
replace i_groupsV1="Cereals - rice" if concorded_itemlabel2=="Khoi, lawa"
replace i_groupsV1="Cereals - rice" if concorded_itemlabel2=="Muri"
replace i_groupsV1="Cereals - coarse" if concorded_itemlabel2=="Small millets & products"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Bread (bakery)"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Sewai, noodles"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Suji, Rawa"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Maida"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Wheat/Atta"
replace i_groupsV1="Cereals - wheat" if concorded_itemlabel2=="Other wheat products"
replace i_groupsV1="Gram" if concorded_itemlabel2=="Gram products"
replace i_groupsV1="Gram" if concorded_itemlabel2=="Gram (full grain/whole)"
replace i_groupsV1="Pulses - Besan, Moong" if concorded_itemlabel2=="Other pulse products"
replace i_groupsV1="Pulses - Besan, Moong" if concorded_itemlabel2=="Besan"
replace i_groupsV1="Pulses - Besan, Moong" if concorded_itemlabel2=="Moong"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Khasari"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="peas dry"
pause
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Urd"
replace i_groupsV1="Pulses - Besan, Moong" if concorded_itemlabel2=="soyabean"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Arhar (tur)"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Masur"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Gram (split)"
replace i_groupsV1="Pulses - Urd, Masur" if concorded_itemlabel2=="Other pulses"
replace i_groupsV1="Ghee " if concorded_itemlabel2=="Ghee"
replace i_groupsV1="Milk" if concorded_itemlabel2=="Milk (liquid, litre)"
replace i_groupsV1="Ghee " if concorded_itemlabel2=="Butter"
replace i_groupsV1="Other milk products" if concorded_itemlabel2=="Baby food"
replace i_groupsV1="Other milk products" if concorded_itemlabel2=="Milk (condensed/ powder)"
replace i_groupsV1="Other milk products" if concorded_itemlabel2=="Other milk products"
replace i_groupsV1="Other milk products" if concorded_itemlabel2=="Ice-cream"
replace i_groupsV1="Other milk products" if concorded_itemlabel2=="Curd"
replace i_groupsV1="Fish, prawn" if concorded_itemlabel2=="Fish, prawn"
replace i_groupsV1="Meat" if concorded_itemlabel2=="Other meat, birds, and fish"
replace i_groupsV1="Meat" if concorded_itemlabel2=="Chicken"
replace i_groupsV1="Eggs" if concorded_itemlabel2=="Eggs (no.)"
replace i_groupsV1="Meat" if concorded_itemlabel2=="Beef/ buffalo meat"
replace i_groupsV1="Meat" if concorded_itemlabel2=="Goat meat/mutton"
replace i_groupsV1="Meat" if concorded_itemlabel2=="Pork"
replace i_groupsV1="Vanaspati, margarine" if concorded_itemlabel2=="Vanaspati, margarine"
replace i_groupsV1="edible oils" if concorded_itemlabel2=="Edible oil (others)"
replace i_groupsV1="edible oils" if concorded_itemlabel2=="Coconut oil"
replace i_groupsV1="edible oils" if concorded_itemlabel2=="Ground nut oil"
replace i_groupsV1="edible oils" if concorded_itemlabel2=="Mustard oil"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Jhinga, torai"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Parwal, patal"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Bitter gourd"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Pumpkin"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Gourd"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Snake gourd"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Other gourds"
replace i_groupsV1="Vegetable - gourds" if concorded_itemlabel2=="Cucumber"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Palak/other leafy vegetables"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Tomato"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="French beans and barbati"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Lady's finger"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Cabbage"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Brinjal"
replace i_groupsV1="Vegetable - leafy vegetables" if concorded_itemlabel2=="Cauliflower"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Chilli (green)"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Other vegetables"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="peas fresh"
pause
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Plantain (green)"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Capsicum"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Lemon"
replace i_groupsV1="Vegetable - other vegetables" if concorded_itemlabel2=="Jackfruit (green)"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Beet"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Arum"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Onion"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Turnip"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Carrot"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Potato"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Radish"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Other vegetables"
replace i_groupsV1="Vegetable - root vegetables" if concorded_itemlabel2=="Sweet potato"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Walnut"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Other nuts"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Coconut (copra)"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Groundnut"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Other dry fruits"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Raisin (kishmish, monacca, etc.)"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Cashewnut"
replace i_groupsV1="Dry fruits and nuts" if concorded_itemlabel2=="Dates"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Apple"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Grapes"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Leechi"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Orange, mausami (no.)"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Pineapple"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Pears (naspati)"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Mango"
replace i_groupsV1="Premium Fruits" if concorded_itemlabel2=="Watermelon"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Banana"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Other fresh fruits"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Kharbooza"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Jackfruit"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Coconut"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Singara"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Guava"
replace i_groupsV1="Other Fresh fruits" if concorded_itemlabel2=="Berries"
replace i_groupsV1="salt" if concorded_itemlabel2=="Salt"
replace i_groupsV1="spices" if concorded_itemlabel2=="Turmeric (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Dry chillies (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Tamarind (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Black pepper (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Garlic (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Ginger (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Other spices (gm)"
replace i_groupsV1="spices" if concorded_itemlabel2=="Curry powder (gm)"
replace i_groupsV1="sugar" if concorded_itemlabel2=="Gur"
replace i_groupsV1="sugar" if concorded_itemlabel2=="Sugar (others)"
replace i_groupsV1="sugar" if concorded_itemlabel2=="Sugar candy (misri)"
replace i_groupsV1="sugar" if concorded_itemlabel2=="Sugar"
replace i_groupsV1="sugar" if concorded_itemlabel2=="Honey"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Cold beverage (bottled or canned) no."
replace i_groupsV1="beverages" if concorded_itemlabel2=="Coffee (powder)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Tea (cups)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Ice"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Fruit juice and shake (glass)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Tea (leaf)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Coffee (cups)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Coconut green (no.)"
replace i_groupsV1="beverages" if concorded_itemlabel2=="Other beverages: cocoa, chocolate, etc."
replace i_groupsV1="processed food" if concorded_itemlabel2=="Cooked meals"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Prepared sweets"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Salted refreshments"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Other processed food (gm.)"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Sauce (gm.)"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Biscuits"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Pickles (gm.)"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Cake, pastry"
replace i_groupsV1="processed food" if concorded_itemlabel2=="Jam, jelly (gm.)"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Foreign liquor or refined liquor (brandy, whisky etc.) (litre)"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Other drugs and intoxicants"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Ganja"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Country liquor"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Toddy"
replace i_groupsV1="Intoxicants" if concorded_itemlabel2=="Beer (litre)"
replace i_groupsV1="Pan" if concorded_itemlabel2=="Lime"
replace i_groupsV1="Pan" if concorded_itemlabel2=="Pan (leaf)"
replace i_groupsV1="Pan" if concorded_itemlabel2=="other ingredients for pan"
replace i_groupsV1="Pan" if concorded_itemlabel2=="Supari"
replace i_groupsV1="Pan" if concorded_itemlabel2=="Katha"
replace i_groupsV1="Pan" if concorded_itemlabel2=="Pan (finished)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Leaf tobacco"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Cheroot (no.)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Bidi"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Other tobacco products (gm)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Snuff (gm)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Hookah tobacco (kg.)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Zarda, kimam, surti (gm.)"
replace i_groupsV1="Tobacco" if concorded_itemlabel2=="Cigarettes"
replace i_groupsV1="Matches" if concorded_itemlabel2=="Matches"
replace i_groupsV1="Electricity" if concorded_itemlabel2=="Electricity"
replace i_groupsV1="Firewood and chips" if concorded_itemlabel2=="Firewood and chips"
replace i_groupsV1="Coke, coal, charcoal" if concorded_itemlabel2=="Coal"
replace i_groupsV1="Coke, coal, charcoal" if concorded_itemlabel2=="Coke"
replace i_groupsV1="Firewood and chips" if concorded_itemlabel2=="Dung cake"
replace i_groupsV1="Kerosene" if concorded_itemlabel2=="Kerosene"
replace i_groupsV1="Coke, coal, charcoal" if concorded_itemlabel2=="Charcoal (kg.)"
replace i_groupsV1="Other fuel" if concorded_itemlabel2=="Candle (no.)"
replace i_groupsV1="Other fuel" if concorded_itemlabel2=="Other fuel"
replace i_groupsV1="Other fuel" if concorded_itemlabel2=="Gobar gas"
replace i_groupsV1="Other fuel" if concorded_itemlabel2=="L.P.G [kg.]"

*generate g_groups:
gen g_groupsV1=""
replace g_groupsV1="cereals" if i_groupsV1=="Cereals - coarse"
replace g_groupsV1="cereals" if i_groupsV1=="Cereals - rice"
replace g_groupsV1="cereals" if i_groupsV1=="Cereals - wheat"
replace g_groupsV1="gram and pulses" if i_groupsV1=="Gram"
replace g_groupsV1="gram and pulses" if i_groupsV1=="Pulses - Besan, Moong"
replace g_groupsV1="gram and pulses" if i_groupsV1=="Pulses - Urd, Masur"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Ghee "
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Milk"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Other milk products"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Fish, prawn"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Meat"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Eggs"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="Vanaspati, margarine"
replace g_groupsV1="milk, meat and oils" if i_groupsV1=="edible oils"
replace g_groupsV1="vegetables" if i_groupsV1=="Vegetable - gourds"
replace g_groupsV1="vegetables" if i_groupsV1=="Vegetable - leafy vegetables"
replace g_groupsV1="vegetables" if i_groupsV1=="Vegetable - other vegetables"
replace g_groupsV1="vegetables" if i_groupsV1=="Vegetable - root vegetables"
replace g_groupsV1="fruits" if i_groupsV1=="Dry fruits and nuts"
replace g_groupsV1="fruits" if i_groupsV1=="Premium Fruits"
replace g_groupsV1="fruits" if i_groupsV1=="Other Fresh fruits"
replace g_groupsV1="sugar, salt and spices" if i_groupsV1=="salt"
replace g_groupsV1="sugar, salt and spices" if i_groupsV1=="spices"
replace g_groupsV1="sugar, salt and spices" if i_groupsV1=="sugar"
replace g_groupsV1="refreshments and intoxicants" if i_groupsV1=="beverages"
replace g_groupsV1="refreshments and intoxicants" if i_groupsV1=="processed food"
replace g_groupsV1="refreshments and intoxicants" if i_groupsV1=="Intoxicants"
replace g_groupsV1="refreshments and intoxicants" if i_groupsV1=="Pan"
replace g_groupsV1="refreshments and intoxicants" if i_groupsV1=="Tobacco"
replace g_groupsV1="fuel and light" if i_groupsV1=="Matches"
replace g_groupsV1="fuel and light" if i_groupsV1=="Electricity"
replace g_groupsV1="fuel and light" if i_groupsV1=="Firewood and chips"
replace g_groupsV1="fuel and light" if i_groupsV1=="Coke, coal, charcoal"
replace g_groupsV1="fuel and light" if i_groupsV1=="Kerosene"
replace g_groupsV1="fuel and light" if i_groupsV1=="Other fuel"

gen g_groupsV2=""
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Cereals - coarse"
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Cereals - rice"
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Cereals - wheat"
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Gram"
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Pulses - Besan, Moong"
replace g_groupsV2="cereals and pulses" if i_groupsV1=="Pulses - Urd, Masur"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Ghee "
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Milk"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Other milk products"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Fish, prawn"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Meat"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Eggs"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="Vanaspati, margarine"
replace g_groupsV2="milk, meat and oils" if i_groupsV1=="edible oils"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Vegetable - gourds"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Vegetable - leafy vegetables"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Vegetable - other vegetables"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Vegetable - root vegetables"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Dry fruits and nuts"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Premium Fruits"
replace g_groupsV2="fruits and vegetables" if i_groupsV1=="Other Fresh fruits"
replace g_groupsV2="sugar, salt and spices" if i_groupsV1=="salt"
replace g_groupsV2="sugar, salt and spices" if i_groupsV1=="spices"
replace g_groupsV2="sugar, salt and spices" if i_groupsV1=="sugar"
replace g_groupsV2="refreshments and intoxicants" if i_groupsV1=="beverages"
replace g_groupsV2="refreshments and intoxicants" if i_groupsV1=="processed food"
replace g_groupsV2="refreshments and intoxicants" if i_groupsV1=="Intoxicants"
replace g_groupsV2="refreshments and intoxicants" if i_groupsV1=="Pan"
replace g_groupsV2="refreshments and intoxicants" if i_groupsV1=="Tobacco"
replace g_groupsV2="fuel and light" if i_groupsV1=="Matches"
replace g_groupsV2="fuel and light" if i_groupsV1=="Electricity"
replace g_groupsV2="fuel and light" if i_groupsV1=="Firewood and chips"
replace g_groupsV2="fuel and light" if i_groupsV1=="Coke, coal, charcoal"
replace g_groupsV2="fuel and light" if i_groupsV1=="Kerosene"
replace g_groupsV2="fuel and light" if i_groupsV1=="Other fuel"

gen g_groupsV3=""
replace g_groupsV3="food unprocessed" if i_groupsV1=="Cereals - coarse"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Cereals - rice"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Cereals - wheat"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Gram"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Pulses - Besan, Moong"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Pulses - Urd, Masur"
replace g_groupsV3="food processed" if i_groupsV1=="Ghee "
replace g_groupsV3="food processed" if i_groupsV1=="Milk"
replace g_groupsV3="food processed" if i_groupsV1=="Other milk products"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Fish, prawn"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Meat"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Eggs"
replace g_groupsV3="food processed" if i_groupsV1=="Vanaspati, margarine"
replace g_groupsV3="food processed" if i_groupsV1=="edible oils"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Vegetable - gourds"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Vegetable - leafy vegetables"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Vegetable - other vegetables"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Vegetable - root vegetables"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Dry fruits and nuts"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Premium Fruits"
replace g_groupsV3="food unprocessed" if i_groupsV1=="Other Fresh fruits"
replace g_groupsV3="food processed" if i_groupsV1=="salt"
replace g_groupsV3="food processed" if i_groupsV1=="spices"
replace g_groupsV3="food processed" if i_groupsV1=="sugar"
replace g_groupsV3="food processed" if i_groupsV1=="beverages"
replace g_groupsV3="food processed" if i_groupsV1=="processed food"
replace g_groupsV3="food processed" if i_groupsV1=="Intoxicants"
replace g_groupsV3="food processed" if i_groupsV1=="Pan"
replace g_groupsV3="food processed" if i_groupsV1=="Tobacco"
replace g_groupsV3="non-food" if i_groupsV1=="Matches"
replace g_groupsV3="non-food" if i_groupsV1=="Electricity"
replace g_groupsV3="non-food" if i_groupsV1=="Firewood and chips"
replace g_groupsV3="non-food" if i_groupsV1=="Coke, coal, charcoal"
replace g_groupsV3="non-food" if i_groupsV1=="Kerosene"
replace g_groupsV3="non-food" if i_groupsV1=="Other fuel"


preserve
keep expenditure hhid concorded_itemlabel2 itemcode43 Srl_no_of_item quantity expenditure i_groupsV1 g_groupsV1 g_groupsV2 g_groupsV3 round state43 district43 sector wt hhsize mpce flag_mpce  flag_deaton_drops kids Religion Caste HH_education Household_size Age
save "$intermediate/R43R55/expenditures_item_level_R43R55_i_groupsV1.dta",replace
restore

*Collapse expenditures at the hhd and i_group_level:
preserve

collapse (sum) expenditure, by(hhid i_groupsV1 g_groupsV1 g_groupsV2 g_groupsV3 round state43 district43 sector wt hhsize mpce flag_mpce kids Religion Caste HH_education Household_size  Age)
save "$intermediate/R43R55/expenditures_R43R55_i_groupsV1.dta",replace

restore

drop if flag_deaton_drops==1
collapse (sum) expenditure, by(hhid i_groupsV1 g_groupsV1 g_groupsV2 g_groupsV3 round state43 district43 sector wt hhsize mpce flag_mpce kids Religion Caste HH_education Household_size  Age)
save "$intermediate/R43R55/expenditures_R43R55_i_groupsV1_D.dta",replace

}

